<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"vchao.top","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="# 概览 简介Vitamio 能够流畅播放720P甚至1080P高清MKV，FLV，MP4，MOV，TS，RMVB等常见格式的视频，还可以在 Android 与 iOS 上跨平台支持 MMS, RTSP, RTMP, HLS(m3u8) 等常见的多种视频流媒体协议，包括点播与直播。Vitamio 凭借其简洁易用的 API 接口赢得了全球众多开发者的青睐，到目前，全球已经有超过 10,000 种应">
<meta property="og:type" content="article">
<meta property="og:title" content="视频播放库Vitamio的使用以及功能扩展">
<meta property="og:url" content="http://vchao.top/2018/07/13/%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%BA%93Vitamio%E7%9A%84%E4%BD%BF%E7%94%A8%E4%BB%A5%E5%8F%8A%E5%8A%9F%E8%83%BD%E6%89%A9%E5%B1%95/index.html">
<meta property="og:site_name" content="乘风破浪">
<meta property="og:description" content="# 概览 简介Vitamio 能够流畅播放720P甚至1080P高清MKV，FLV，MP4，MOV，TS，RMVB等常见格式的视频，还可以在 Android 与 iOS 上跨平台支持 MMS, RTSP, RTMP, HLS(m3u8) 等常见的多种视频流媒体协议，包括点播与直播。Vitamio 凭借其简洁易用的 API 接口赢得了全球众多开发者的青睐，到目前，全球已经有超过 10,000 种应">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2018-07-13T12:46:25.000Z">
<meta property="article:modified_time" content="2021-08-25T14:37:20.815Z">
<meta property="article:author" content="vchao">
<meta property="article:tag" content="Android">
<meta property="article:tag" content="Vitamio">
<meta property="article:tag" content="三方库">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://vchao.top/2018/07/13/%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%BA%93Vitamio%E7%9A%84%E4%BD%BF%E7%94%A8%E4%BB%A5%E5%8F%8A%E5%8A%9F%E8%83%BD%E6%89%A9%E5%B1%95/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>视频播放库Vitamio的使用以及功能扩展 | 乘风破浪</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">乘风破浪</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://vchao.top/2018/07/13/%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%BA%93Vitamio%E7%9A%84%E4%BD%BF%E7%94%A8%E4%BB%A5%E5%8F%8A%E5%8A%9F%E8%83%BD%E6%89%A9%E5%B1%95/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="vchao">
      <meta itemprop="description" content="怀揣好奇，梦想改变世界的菜鸟极客">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="乘风破浪">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          视频播放库Vitamio的使用以及功能扩展
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2018-07-13 20:46:25" itemprop="dateCreated datePublished" datetime="2018-07-13T20:46:25+08:00">2018-07-13</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-08-25 22:37:20" itemprop="dateModified" datetime="2021-08-25T22:37:20+08:00">2021-08-25</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>﻿# 概览</p>
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>Vitamio 能够流畅播放720P甚至1080P高清MKV，FLV，MP4，MOV，TS，RMVB等常见格式的视频，还可以在 Android 与 iOS 上跨平台支持 MMS, RTSP, RTMP, HLS(m3u8) 等常见的多种视频流媒体协议，包括点播与直播。<br>Vitamio 凭借其简洁易用的 API 接口赢得了全球众多开发者的青睐，到目前，全球已经有超过 10,000 种应用在使用 Vitamio，覆盖用户超过5亿。</p>
<blockquote>
<p>最近更新较少，上一次更新（2017-04-01）已经是两年前了，但是这并不妨碍它是一个优秀的框架。</p>
</blockquote>
<p>Vitamio 官网：<a target="_blank" rel="noopener" href="http://www.vitamio.org/">http://www.vitamio.org</a><br>github: <a target="_blank" rel="noopener" href="https://github.com/yixia/VitamioBundle">https://github.com/yixia/VitamioBundle</a><br>使用博客：农民伯伯：<a target="_blank" rel="noopener" href="http://www.cnblogs.com/over140/category/409230.html%EF%BC%88%E5%BC%80%E5%8F%91%E8%80%85%E4%B9%8B%E4%B8%80%EF%BC%8C%E6%9C%89%E5%A4%A7%E9%87%8F%E7%9A%84%E6%96%87%E6%A1%A3%EF%BC%89">http://www.cnblogs.com/over140/category/409230.html（开发者之一，有大量的文档）</a></p>
<h2 id="本文内容"><a href="#本文内容" class="headerlink" title="本文内容"></a>本文内容</h2><p>本文对其使用进行了一些扩展和功能的丰富，将其整理后汇总。除集成外，扩展功能如下：</p>
<ol>
<li>双击暂停，开始播放</li>
<li>全屏播放</li>
<li>倍速播放</li>
<li>左边上下滑动调节亮度</li>
<li>右边上下滑动调节声音</li>
<li>左右滑动快进快退</li>
<li>退出时保留播放进度</li>
<li>全屏播放时根据手机方向变化，屏幕自动旋转</li>
<li>进度条控件大小和位置的设置</li>
</ol>
<h2 id="注意事项"><a href="#注意事项" class="headerlink" title="注意事项"></a>注意事项</h2><p><strong>个人使用免费，商用需要授权</strong><br> 大家如果商用的话，别忘了去要授权……</p>
<h1 id="集成"><a href="#集成" class="headerlink" title="集成"></a>集成</h1><h2 id="导入"><a href="#导入" class="headerlink" title="导入"></a>导入</h2><p>github地址: <a target="_blank" rel="noopener" href="https://github.com/yixia/VitamioBundle">https://github.com/yixia/VitamioBundle</a><br>首先从github上下载源文件，然后以 module的方式导入工程中，即可开始使用。</p>
<ol>
<li>导入module，在Android Studio 中依次点击 File –&gt;New –&gt; Import Module…，然后在弹出框中选择文件的路径。</li>
<li>添加依赖，打开Project Structure选项卡，点击左上角的’+’按钮，然后按照提示添加即可。 <blockquote>
<p>目前为止，github上的代码已经很久没有维护了，上次维护应该还是 [2014-04-18] 发布的 4.2.2 版本。所以并不推荐用在公司项目中，一是很久没有维护了，二是需要授权。</p>
</blockquote>
</li>
<li>打开app/src/main目录下的AndroidManifest.xml,注册io.vov.vitamio.activity.InitActivity<br><activity
 android:name="io.vov.vitamio.activity.InitActivity"
 android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
 android:launchMode="singleTop"
 android:theme="@android:style/Theme.NoTitleBar"
 android:windowSoftInputMode="stateAlwaysHidden" /><br>注意:这个InitActivity存在于vitamio/src/对应的目录下,不需要用户编写.</li>
</ol>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;activity</span><br><span class="line">    android:name=&quot;io.vov.vitamio.activity.InitActivity&quot;</span><br><span class="line">    android:configChanges=&quot;orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation&quot;</span><br><span class="line">    android:launchMode=&quot;singleTop&quot;</span><br><span class="line">    android:theme=&quot;@android:style/Theme.NoTitleBar&quot;</span><br><span class="line">    android:windowSoftInputMode=&quot;stateAlwaysHidden&quot; /&gt;</span><br></pre></td></tr></table></figure>

<p>至此,vitamio导入完毕.</p>
<h1 id="扩展功能"><a href="#扩展功能" class="headerlink" title="扩展功能"></a>扩展功能</h1><p>需求。左侧上下滑动调节亮度，右侧上下滑动调节声音，中间添加提示：<br>界面文件，因为点击之后控制器会布满屏幕，所及监听和显示组件都要添加到 MediaController中<br>在这里我们采用手势去处理</p>
<h2 id="1-双击暂停，开始播放"><a href="#1-双击暂停，开始播放" class="headerlink" title="1. 双击暂停，开始播放"></a>1. 双击暂停，开始播放</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//播放与暂停</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">playOrPause</span><span class="params">()</span></span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (videoView != <span class="keyword">null</span>)</span><br><span class="line">        <span class="keyword">if</span> (videoView.isPlaying()) &#123;</span><br><span class="line">            videoView.pause();</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            videoView.start();</span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="2-全屏播放"><a href="#2-全屏播放" class="headerlink" title="2. 全屏播放"></a>2. 全屏播放</h2><p>全屏播放，点击按钮后隐藏其他控件，重设尺寸即可<br>半屏播放同理</p>
<h2 id="3-倍速播放"><a href="#3-倍速播放" class="headerlink" title="3. 倍速播放"></a>3. 倍速播放</h2><p>Vitamio 支持倍速播放，可以根据项目需求进行设置</p>
<h2 id="4-左边上下滑动调节亮度"><a href="#4-左边上下滑动调节亮度" class="headerlink" title="4. 左边上下滑动调节亮度"></a>4. 左边上下滑动调节亮度</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 滑动改变亮度</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> percent</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">onBrightnessSlide</span><span class="params">(<span class="keyword">float</span> percent)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (mBrightness &lt; <span class="number">0</span>) &#123;</span><br><span class="line">        mBrightness = activity.getWindow().getAttributes().screenBrightness;</span><br><span class="line">        <span class="keyword">if</span> (mBrightness &lt;= <span class="number">0.00f</span>)</span><br><span class="line">            mBrightness = <span class="number">0.50f</span>;</span><br><span class="line">        <span class="keyword">if</span> (mBrightness &lt; <span class="number">0.01f</span>)</span><br><span class="line">            mBrightness = <span class="number">0.01f</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 显示</span></span><br><span class="line">        <span class="comment">//mOperationBg.setImageResource(R.drawable.video_brightness_bg);</span></span><br><span class="line">        mVolumeBrightnessLayout.setVisibility(View.VISIBLE);</span><br><span class="line">        mOperationTv.setVisibility(VISIBLE);</span><br><span class="line"></span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>

<h2 id="5-右边上下滑动调节声音"><a href="#5-右边上下滑动调节声音" class="headerlink" title="5. 右边上下滑动调节声音"></a>5. 右边上下滑动调节声音</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 滑动改变声音大小</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> percent</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">onVolumeSlide</span><span class="params">(<span class="keyword">float</span> percent)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (mVolume == -<span class="number">1</span>) &#123;</span><br><span class="line">        mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);</span><br><span class="line">        <span class="keyword">if</span> (mVolume &lt; <span class="number">0</span>)</span><br><span class="line">            mVolume = <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 显示</span></span><br><span class="line">        mVolumeBrightnessLayout.setVisibility(View.VISIBLE);</span><br><span class="line">        mOperationTv.setVisibility(VISIBLE);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">int</span> index = (<span class="keyword">int</span>) (percent * mMaxVolume) + mVolume;</span><br><span class="line">    <span class="keyword">if</span> (index &gt; mMaxVolume)</span><br><span class="line">        index = mMaxVolume;</span><br><span class="line">    <span class="keyword">else</span> <span class="keyword">if</span> (index &lt; <span class="number">0</span>)</span><br><span class="line">        index = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">if</span> (index &gt;= <span class="number">10</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_100);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (index &gt;= <span class="number">5</span> &amp;&amp; index &lt; <span class="number">10</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_60);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (index &gt; <span class="number">0</span> &amp;&amp; index &lt; <span class="number">5</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_30);</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_no);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//DecimalFormat    df   = new DecimalFormat(&quot;######0.00&quot;);</span></span><br><span class="line">    mOperationTv.setText((<span class="keyword">int</span>) (((<span class="keyword">double</span>) index / mMaxVolume)*<span class="number">100</span>)+<span class="string">&quot;%&quot;</span>);</span><br><span class="line">    <span class="comment">// 变更声音</span></span><br><span class="line">    mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, index, <span class="number">0</span>);</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="6-左右滑动快进快退"><a href="#6-左右滑动快进快退" class="headerlink" title="6. 左右滑动快进快退"></a>6. 左右滑动快进快退</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//滑动监听</span></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onScroll</span><span class="params">(MotionEvent e1, MotionEvent e2, <span class="keyword">float</span> distanceX, <span class="keyword">float</span> distanceY)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">float</span> mOldX = e1.getX(), mOldY = e1.getY();</span><br><span class="line">        <span class="keyword">int</span> y = (<span class="keyword">int</span>) e2.getRawY();</span><br><span class="line">        <span class="keyword">int</span> x = (<span class="keyword">int</span>) e2.getRawX();</span><br><span class="line">        Display disp = activity.getWindowManager().getDefaultDisplay();</span><br><span class="line">        <span class="keyword">int</span> windowWidth = disp.getWidth();</span><br><span class="line">        <span class="keyword">int</span> windowHeight = disp.getHeight();</span><br><span class="line">        <span class="keyword">if</span> (mOldX &gt; windowWidth * <span class="number">3.0</span> / <span class="number">4.0</span>) &#123;<span class="comment">// 右边滑动 屏幕 3/4</span></span><br><span class="line">            onVolumeSlide((mOldY - y) / windowHeight);</span><br><span class="line">        &#125; <span class="keyword">else</span> <span class="keyword">if</span> (mOldX &lt; windowWidth * <span class="number">1.0</span> / <span class="number">4.0</span>) &#123;<span class="comment">// 左边滑动 屏幕 1/4</span></span><br><span class="line">            onBrightnessSlide((mOldY - y) / windowHeight);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">super</span>.onScroll(e1, e2, distanceX, distanceY);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h2 id="7-退出时保留播放进度"><a href="#7-退出时保留播放进度" class="headerlink" title="7. 退出时保留播放进度"></a>7. 退出时保留播放进度</h2><p>当页面失去焦点时，保存当前播放进度数值，然后当恢复播放的时候，重新设置进度</p>
<h2 id="8-全屏播放时根据手机方向变化，屏幕自动旋转"><a href="#8-全屏播放时根据手机方向变化，屏幕自动旋转" class="headerlink" title="8. 全屏播放时根据手机方向变化，屏幕自动旋转"></a>8. 全屏播放时根据手机方向变化，屏幕自动旋转</h2><p>首先确定开始收集转屏，然后页面设置中设置为响应屏幕方向的变化，即可自动切换</p>
<h2 id="9-进度条控件大小和位置的设置"><a href="#9-进度条控件大小和位置的设置" class="headerlink" title="9. 进度条控件大小和位置的设置"></a>9. 进度条控件大小和位置的设置</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="function"><span class="keyword">protected</span> View <span class="title">makeControllerView</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    View v = ((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(getResources().getIdentifier(<span class="string">&quot;mymediacontroller&quot;</span>, <span class="string">&quot;layout&quot;</span>, getContext().getPackageName()), <span class="keyword">this</span>);</span><br><span class="line">    v.setMinimumHeight(controllerWidth);</span><br><span class="line">	</span><br><span class="line">	... <span class="comment">// 省略其他代码</span></span><br><span class="line"></span><br><span class="line">    mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);</span><br><span class="line">    mMaxVolume = mAudioManager</span><br><span class="line">            .getStreamMaxVolume(AudioManager.STREAM_MUSIC);</span><br><span class="line">    <span class="keyword">return</span> v;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h1 id="完整代码"><a href="#完整代码" class="headerlink" title="完整代码"></a>完整代码</h1><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">MyMediaController</span> <span class="keyword">extends</span> <span class="title">MediaController</span> </span>&#123;</span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">int</span> HIDEFRAM = <span class="number">0</span>;<span class="comment">//控制提示窗口的显示</span></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">int</span> SHOW_PROGRESS = <span class="number">2</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> GestureDetector mGestureDetector;<span class="comment">//手势监听类</span></span><br><span class="line"><span class="keyword">private</span> ImageButton img_back;<span class="comment">//返回键</span></span><br><span class="line"><span class="keyword">private</span> ImageView img_Battery;<span class="comment">//电池电量显示</span></span><br><span class="line"><span class="keyword">private</span> TextView textViewTime;<span class="comment">//时间提示</span></span><br><span class="line"><span class="keyword">private</span> TextView textViewBattery;<span class="comment">//文字显示电池</span></span><br><span class="line"><span class="keyword">private</span> VideoView videoView;</span><br><span class="line"><span class="keyword">private</span> Activity activity;</span><br><span class="line"><span class="keyword">private</span> Context context;</span><br><span class="line"><span class="keyword">private</span> <span class="keyword">int</span> controllerWidth = <span class="number">0</span>;<span class="comment">//设置mediaController高度为了使横屏时top显示在屏幕顶端</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> View mVolumeBrightnessLayout;<span class="comment">//提示窗口</span></span><br><span class="line"><span class="keyword">private</span> ImageView mOperationBg;<span class="comment">//提示图片</span></span><br><span class="line"><span class="keyword">private</span> TextView mOperationTv;<span class="comment">//提示文字</span></span><br><span class="line"><span class="keyword">private</span> AudioManager mAudioManager;</span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> SeekBar progress;</span><br><span class="line"><span class="keyword">private</span> <span class="keyword">boolean</span> mDragging;</span><br><span class="line"><span class="keyword">private</span> MediaPlayerControl player;</span><br><span class="line"><span class="comment">//最大声音</span></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">int</span> mMaxVolume;</span><br><span class="line"><span class="comment">// 当前声音</span></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">int</span> mVolume = -<span class="number">1</span>;</span><br><span class="line"><span class="comment">//当前亮度</span></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">float</span> mBrightness = -<span class="number">1f</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//返回监听</span></span><br><span class="line"><span class="keyword">private</span> View.OnClickListener backListener = <span class="keyword">new</span> View.OnClickListener() &#123;</span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onClick</span><span class="params">(View v)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity != <span class="keyword">null</span>)&#123;</span><br><span class="line">            activity.finish();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> Handler myHandler = <span class="keyword">new</span> Handler() &#123;</span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">handleMessage</span><span class="params">(Message msg)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">long</span> pos;</span><br><span class="line">        <span class="keyword">switch</span> (msg.what) &#123;</span><br><span class="line">            <span class="keyword">case</span> HIDEFRAM:<span class="comment">//隐藏提示窗口</span></span><br><span class="line">                mVolumeBrightnessLayout.setVisibility(View.GONE);</span><br><span class="line">                mOperationTv.setVisibility(View.GONE);</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">//videoview 用于对视频进行控制的等，activity为了退出</span></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="title">MyMediaController</span><span class="params">(Context context, VideoView videoView , Activity activity)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">super</span>(context);</span><br><span class="line">    <span class="keyword">this</span>.context = context;</span><br><span class="line">    <span class="keyword">this</span>.videoView = videoView;</span><br><span class="line">    <span class="keyword">this</span>.activity = activity;</span><br><span class="line">    WindowManager wm = (WindowManager) context</span><br><span class="line">            .getSystemService(Context.WINDOW_SERVICE);</span><br><span class="line">    controllerWidth = wm.getDefaultDisplay().getWidth();</span><br><span class="line">    mGestureDetector = <span class="keyword">new</span> GestureDetector(context, <span class="keyword">new</span> MyGestureListener());</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="function"><span class="keyword">protected</span> View <span class="title">makeControllerView</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    View v = ((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(getResources().getIdentifier(<span class="string">&quot;mymediacontroller&quot;</span>, <span class="string">&quot;layout&quot;</span>, getContext().getPackageName()), <span class="keyword">this</span>);</span><br><span class="line">    v.setMinimumHeight(controllerWidth);</span><br><span class="line">    <span class="comment">//TOP</span></span><br><span class="line"><span class="comment">//        img_back = (ImageButton) v.findViewById(getResources().getIdentifier(&quot;mediacontroller_top_back&quot;, &quot;id&quot;, context.getPackageName()));</span></span><br><span class="line"><span class="comment">//        img_Battery = (ImageView) v.findViewById(getResources().getIdentifier(&quot;mediacontroller_imgBattery&quot;, &quot;id&quot;, context.getPackageName()));</span></span><br><span class="line"><span class="comment">//        img_back.setOnClickListener(backListener);</span></span><br><span class="line"><span class="comment">//        textViewBattery = (TextView)v.findViewById(getResources().getIdentifier(&quot;mediacontroller_Battery&quot;, &quot;id&quot;, context.getPackageName()));</span></span><br><span class="line"><span class="comment">//        textViewTime = (TextView)v.findViewById(getResources().getIdentifier(&quot;mediacontroller_time&quot;, &quot;id&quot;, context.getPackageName()));</span></span><br><span class="line">    img_back = (ImageButton) v.findViewById(R.id.mediacontroller_top_back);</span><br><span class="line">    img_Battery = (ImageView) v.findViewById(R.id.mediacontroller_imgBattery);</span><br><span class="line">    img_back.setOnClickListener(backListener);</span><br><span class="line">    textViewBattery = (TextView)v.findViewById(R.id.mediacontroller_Battery);</span><br><span class="line">    textViewTime = (TextView)v.findViewById(R.id.mediacontroller_time);</span><br><span class="line">    progress = (SeekBar)v.findViewById(R.id.mediacontroller_seekbar);</span><br><span class="line">    <span class="comment">//mid</span></span><br><span class="line">    mVolumeBrightnessLayout = (RelativeLayout)v.findViewById(R.id.operation_volume_brightness);</span><br><span class="line">    mOperationBg = (ImageView)v.findViewById(R.id.operation_bg);</span><br><span class="line">    mOperationTv = (TextView) v.findViewById(R.id.operation_tv);</span><br><span class="line">    mOperationTv.setVisibility(View.GONE);</span><br><span class="line">    mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);</span><br><span class="line">    mMaxVolume = mAudioManager</span><br><span class="line">            .getStreamMaxVolume(AudioManager.STREAM_MUSIC);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> v;</span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">dispatchKeyEvent</span><span class="params">(KeyEvent event)</span> </span>&#123;</span><br><span class="line">    System.out.println(<span class="string">&quot;MYApp-MyMediaController-dispatchKeyEvent&quot;</span>);</span><br><span class="line">    <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onTouchEvent</span><span class="params">(MotionEvent event)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (mGestureDetector.onTouchEvent(event)) <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">    <span class="comment">// 处理手势结束</span></span><br><span class="line">    <span class="keyword">switch</span> (event.getAction() &amp; MotionEvent.ACTION_MASK) &#123;</span><br><span class="line">        <span class="keyword">case</span> MotionEvent.ACTION_UP:</span><br><span class="line">            endGesture();</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> <span class="keyword">super</span>.onTouchEvent(event);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 手势结束</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">endGesture</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    mVolume = -<span class="number">1</span>;</span><br><span class="line">    mBrightness = -<span class="number">1f</span>;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 隐藏</span></span><br><span class="line">    myHandler.removeMessages(HIDEFRAM);</span><br><span class="line">    myHandler.sendEmptyMessageDelayed(HIDEFRAM, <span class="number">1</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> <span class="class"><span class="keyword">class</span> <span class="title">MyGestureListener</span> <span class="keyword">extends</span> <span class="title">GestureDetector</span>.<span class="title">SimpleOnGestureListener</span> </span>&#123;</span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onSingleTapUp</span><span class="params">(MotionEvent e)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">false</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onSingleTapConfirmed</span><span class="params">(MotionEvent e)</span> </span>&#123;</span><br><span class="line">        <span class="comment">//当收拾结束，并且是单击结束时，控制器隐藏/显示</span></span><br><span class="line">        toggleMediaControlsVisiblity();</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">super</span>.onSingleTapConfirmed(e);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onDown</span><span class="params">(MotionEvent e)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">    &#125;</span><br><span class="line"><span class="comment">//滑动监听</span></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onScroll</span><span class="params">(MotionEvent e1, MotionEvent e2, <span class="keyword">float</span> distanceX, <span class="keyword">float</span> distanceY)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">float</span> mOldX = e1.getX(), mOldY = e1.getY();</span><br><span class="line">        <span class="keyword">int</span> y = (<span class="keyword">int</span>) e2.getRawY();</span><br><span class="line">        <span class="keyword">int</span> x = (<span class="keyword">int</span>) e2.getRawX();</span><br><span class="line">        Display disp = activity.getWindowManager().getDefaultDisplay();</span><br><span class="line">        <span class="keyword">int</span> windowWidth = disp.getWidth();</span><br><span class="line">        <span class="keyword">int</span> windowHeight = disp.getHeight();</span><br><span class="line">        <span class="keyword">if</span> (mOldX &gt; windowWidth * <span class="number">3.0</span> / <span class="number">4.0</span>) &#123;<span class="comment">// 右边滑动 屏幕 3/4</span></span><br><span class="line">            onVolumeSlide((mOldY - y) / windowHeight);</span><br><span class="line">        &#125; <span class="keyword">else</span> <span class="keyword">if</span> (mOldX &lt; windowWidth * <span class="number">1.0</span> / <span class="number">4.0</span>) &#123;<span class="comment">// 左边滑动 屏幕 1/4</span></span><br><span class="line">            onBrightnessSlide((mOldY - y) / windowHeight);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">super</span>.onScroll(e1, e2, distanceX, distanceY);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//双击暂停或开始</span></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onDoubleTap</span><span class="params">(MotionEvent e)</span> </span>&#123;</span><br><span class="line">        playOrPause();</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">onFling</span><span class="params">(MotionEvent e1, MotionEvent e2, <span class="keyword">float</span> velocityX, <span class="keyword">float</span> velocityY)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">super</span>.onFling(e1, e2, velocityX, velocityY);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 滑动改变声音大小</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> percent</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">onVolumeSlide</span><span class="params">(<span class="keyword">float</span> percent)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (mVolume == -<span class="number">1</span>) &#123;</span><br><span class="line">        mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);</span><br><span class="line">        <span class="keyword">if</span> (mVolume &lt; <span class="number">0</span>)</span><br><span class="line">            mVolume = <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 显示</span></span><br><span class="line">        mVolumeBrightnessLayout.setVisibility(View.VISIBLE);</span><br><span class="line">        mOperationTv.setVisibility(VISIBLE);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">int</span> index = (<span class="keyword">int</span>) (percent * mMaxVolume) + mVolume;</span><br><span class="line">    <span class="keyword">if</span> (index &gt; mMaxVolume)</span><br><span class="line">        index = mMaxVolume;</span><br><span class="line">    <span class="keyword">else</span> <span class="keyword">if</span> (index &lt; <span class="number">0</span>)</span><br><span class="line">        index = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">if</span> (index &gt;= <span class="number">10</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_100);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (index &gt;= <span class="number">5</span> &amp;&amp; index &lt; <span class="number">10</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_60);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (index &gt; <span class="number">0</span> &amp;&amp; index &lt; <span class="number">5</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_30);</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.volmn_no);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//DecimalFormat    df   = new DecimalFormat(&quot;######0.00&quot;);</span></span><br><span class="line">    mOperationTv.setText((<span class="keyword">int</span>) (((<span class="keyword">double</span>) index / mMaxVolume)*<span class="number">100</span>)+<span class="string">&quot;%&quot;</span>);</span><br><span class="line">    <span class="comment">// 变更声音</span></span><br><span class="line">    mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, index, <span class="number">0</span>);</span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 滑动改变亮度</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> percent</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">onBrightnessSlide</span><span class="params">(<span class="keyword">float</span> percent)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (mBrightness &lt; <span class="number">0</span>) &#123;</span><br><span class="line">        mBrightness = activity.getWindow().getAttributes().screenBrightness;</span><br><span class="line">        <span class="keyword">if</span> (mBrightness &lt;= <span class="number">0.00f</span>)</span><br><span class="line">            mBrightness = <span class="number">0.50f</span>;</span><br><span class="line">        <span class="keyword">if</span> (mBrightness &lt; <span class="number">0.01f</span>)</span><br><span class="line">            mBrightness = <span class="number">0.01f</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 显示</span></span><br><span class="line">        <span class="comment">//mOperationBg.setImageResource(R.drawable.video_brightness_bg);</span></span><br><span class="line">        mVolumeBrightnessLayout.setVisibility(View.VISIBLE);</span><br><span class="line">        mOperationTv.setVisibility(VISIBLE);</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    WindowManager.LayoutParams lpa = activity.getWindow().getAttributes();</span><br><span class="line">    lpa.screenBrightness = mBrightness + percent;</span><br><span class="line">    <span class="keyword">if</span> (lpa.screenBrightness &gt; <span class="number">1.0f</span>)</span><br><span class="line">        lpa.screenBrightness = <span class="number">1.0f</span>;</span><br><span class="line">    <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness &lt; <span class="number">0.01f</span>)</span><br><span class="line">        lpa.screenBrightness = <span class="number">0.01f</span>;</span><br><span class="line">    activity.getWindow().setAttributes(lpa);</span><br><span class="line"></span><br><span class="line">    mOperationTv.setText((<span class="keyword">int</span>) (lpa.screenBrightness * <span class="number">100</span>) + <span class="string">&quot;%&quot;</span>);</span><br><span class="line">    <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">90</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_100);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">80</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">90</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_90);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">70</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">80</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_80);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">60</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">70</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_70);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">50</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">60</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_60);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">40</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">50</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_50);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">30</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">40</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_40);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">20</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">20</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_30);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (lpa.screenBrightness * <span class="number">100</span> &gt;= <span class="number">10</span> &amp;&amp; lpa.screenBrightness * <span class="number">100</span> &lt; <span class="number">20</span>) &#123;</span><br><span class="line">        mOperationBg.setImageResource(R.drawable.light_20);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setTime</span><span class="params">(String time)</span></span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (textViewTime != <span class="keyword">null</span>)</span><br><span class="line">        textViewTime.setText(time);</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">//显示电量，</span></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setBattery</span><span class="params">(String stringBattery)</span></span>&#123;</span><br><span class="line">    <span class="keyword">if</span>(textViewTime != <span class="keyword">null</span> &amp;&amp; img_Battery != <span class="keyword">null</span>)&#123;</span><br><span class="line">        textViewBattery.setText(stringBattery + <span class="string">&quot;%&quot;</span>);</span><br><span class="line">        <span class="keyword">int</span> battery = Integer.valueOf(stringBattery);</span><br><span class="line">        <span class="keyword">if</span>(battery &lt; <span class="number">15</span>)img_Battery.setImageDrawable(getResources().getDrawable(R.drawable.battery_15));</span><br><span class="line">        <span class="keyword">if</span>(battery &lt; <span class="number">30</span> &amp;&amp; battery &gt;= <span class="number">15</span>)img_Battery.setImageDrawable(getResources().getDrawable(R.drawable.battery_15));</span><br><span class="line">        <span class="keyword">if</span>(battery &lt; <span class="number">45</span> &amp;&amp; battery &gt;= <span class="number">30</span>)img_Battery.setImageDrawable(getResources().getDrawable(R.drawable.battery_30));</span><br><span class="line">        <span class="keyword">if</span>(battery &lt; <span class="number">60</span> &amp;&amp; battery &gt;= <span class="number">45</span>)img_Battery.setImageDrawable(getResources().getDrawable(R.drawable.battery_45));</span><br><span class="line">        <span class="keyword">if</span>(battery &lt; <span class="number">75</span> &amp;&amp; battery &gt;= <span class="number">60</span>)img_Battery.setImageDrawable(getResources().getDrawable(R.drawable.battery_60));</span><br><span class="line">        <span class="keyword">if</span>(battery &lt; <span class="number">90</span> &amp;&amp; battery &gt;= <span class="number">75</span>)img_Battery.setImageDrawable(getResources().getDrawable(R.drawable.battery_75));</span><br><span class="line">        <span class="keyword">if</span>(battery &gt; <span class="number">90</span> )img_Battery.setImageDrawable(getResources().getDrawable(R.drawable.battery_90));</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">//隐藏/显示</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">toggleMediaControlsVisiblity</span><span class="params">()</span></span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (isShowing()) &#123;</span><br><span class="line">        hide();</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        show();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">//播放与暂停</span></span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">playOrPause</span><span class="params">()</span></span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (videoView != <span class="keyword">null</span>)</span><br><span class="line">        <span class="keyword">if</span> (videoView.isPlaying()) &#123;</span><br><span class="line">            videoView.pause();</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            videoView.start();</span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>




    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Android/" rel="tag"># Android</a>
              <a href="/tags/Vitamio/" rel="tag"># Vitamio</a>
              <a href="/tags/%E4%B8%89%E6%96%B9%E5%BA%93/" rel="tag"># 三方库</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2018/04/12/Android%20Studio%E4%B8%AD%E6%80%8E%E4%B9%88%E4%BD%BF%E7%94%A8DDMS%E5%B7%A5%E5%85%B7%EF%BC%9F/" rel="prev" title="Android Studio中怎么使用DDMS工具？">
      <i class="fa fa-chevron-left"></i> Android Studio中怎么使用DDMS工具？
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/08/25/hello-world/" rel="next" title="Hello World">
      Hello World <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AE%80%E4%BB%8B"><span class="nav-number">1.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9C%AC%E6%96%87%E5%86%85%E5%AE%B9"><span class="nav-number">2.</span> <span class="nav-text">本文内容</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9"><span class="nav-number">3.</span> <span class="nav-text">注意事项</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%9B%86%E6%88%90"><span class="nav-number"></span> <span class="nav-text">集成</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AF%BC%E5%85%A5"><span class="nav-number">1.</span> <span class="nav-text">导入</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%89%A9%E5%B1%95%E5%8A%9F%E8%83%BD"><span class="nav-number"></span> <span class="nav-text">扩展功能</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E5%8F%8C%E5%87%BB%E6%9A%82%E5%81%9C%EF%BC%8C%E5%BC%80%E5%A7%8B%E6%92%AD%E6%94%BE"><span class="nav-number">1.</span> <span class="nav-text">1. 双击暂停，开始播放</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E5%85%A8%E5%B1%8F%E6%92%AD%E6%94%BE"><span class="nav-number">2.</span> <span class="nav-text">2. 全屏播放</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E5%80%8D%E9%80%9F%E6%92%AD%E6%94%BE"><span class="nav-number">3.</span> <span class="nav-text">3. 倍速播放</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E5%B7%A6%E8%BE%B9%E4%B8%8A%E4%B8%8B%E6%BB%91%E5%8A%A8%E8%B0%83%E8%8A%82%E4%BA%AE%E5%BA%A6"><span class="nav-number">4.</span> <span class="nav-text">4. 左边上下滑动调节亮度</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E5%8F%B3%E8%BE%B9%E4%B8%8A%E4%B8%8B%E6%BB%91%E5%8A%A8%E8%B0%83%E8%8A%82%E5%A3%B0%E9%9F%B3"><span class="nav-number">5.</span> <span class="nav-text">5. 右边上下滑动调节声音</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-%E5%B7%A6%E5%8F%B3%E6%BB%91%E5%8A%A8%E5%BF%AB%E8%BF%9B%E5%BF%AB%E9%80%80"><span class="nav-number">6.</span> <span class="nav-text">6. 左右滑动快进快退</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-%E9%80%80%E5%87%BA%E6%97%B6%E4%BF%9D%E7%95%99%E6%92%AD%E6%94%BE%E8%BF%9B%E5%BA%A6"><span class="nav-number">7.</span> <span class="nav-text">7. 退出时保留播放进度</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-%E5%85%A8%E5%B1%8F%E6%92%AD%E6%94%BE%E6%97%B6%E6%A0%B9%E6%8D%AE%E6%89%8B%E6%9C%BA%E6%96%B9%E5%90%91%E5%8F%98%E5%8C%96%EF%BC%8C%E5%B1%8F%E5%B9%95%E8%87%AA%E5%8A%A8%E6%97%8B%E8%BD%AC"><span class="nav-number">8.</span> <span class="nav-text">8. 全屏播放时根据手机方向变化，屏幕自动旋转</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#9-%E8%BF%9B%E5%BA%A6%E6%9D%A1%E6%8E%A7%E4%BB%B6%E5%A4%A7%E5%B0%8F%E5%92%8C%E4%BD%8D%E7%BD%AE%E7%9A%84%E8%AE%BE%E7%BD%AE"><span class="nav-number">9.</span> <span class="nav-text">9. 进度条控件大小和位置的设置</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%AE%8C%E6%95%B4%E4%BB%A3%E7%A0%81"><span class="nav-number"></span> <span class="nav-text">完整代码</span></a></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">vchao</p>
  <div class="site-description" itemprop="description">怀揣好奇，梦想改变世界的菜鸟极客</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">46</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="https://beian.miit.gov.cn/" rel="noopener" target="_blank">冀ICP备 17022751号-1 </a>
      <img src="https://beian.miit.gov.cn" style="display: inline-block;">
  </div>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">vchao</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
